package com.lyk.coursearrange.service;

import com.lyk.coursearrange.common.core.base.result.R;
import com.lyk.coursearrange.common.core.text.SecurityConstants;
import com.lyk.coursearrange.common.log.service.RemoteLogFallbackFactory;
import com.lyk.coursearrange.entity.OperLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteLogService", value = SecurityConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteLogService
{
    /**
     * 保存系统日志
     * @param operLog 日志实体
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/operlog")
    public R<Boolean> saveLog(@RequestBody OperLog operLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
